<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text">
</body>

</html>
<script>
    const inpEle = document.querySelector('input')
    function fn() {
        console.log('我是闭包的事件节流，糟糕，有内奸，停止交易');
    }
    let timerid = null;
    function ssff(ddd, rrr) {
        return function () {
            if (!timerid) {
                timerid = setTimeout(() => {
                    ddd()
                    clearInterval(timerid)
                    timerid = null
                }, rrr)
            }
        }
    }

    inpEle.oninput = ssff(fn,5000)
</script>